<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>image</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="image">
<h1 class="title">image</h1>
<p class="subtitle" id="miscellaneous-image-methods">Miscellaneous image methods</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#accessdefinition" id="id72">AccessDefinition</a></p></li>
<li><p><a class="reference internal" href="#adddefinition" id="id73">AddDefinition</a></p></li>
<li><p><a class="reference internal" href="#adddefinitions" id="id74">AddDefinitions</a></p></li>
<li><p><a class="reference internal" href="#allocateimage" id="id75">AllocateImage</a></p></li>
<li><p><a class="reference internal" href="#allocatenextimage" id="id76">AllocateNextImage</a></p></li>
<li><p><a class="reference internal" href="#animateimages" id="id77">AnimateImages</a></p></li>
<li><p><a class="reference internal" href="#appendimages" id="id78">AppendImages</a></p></li>
<li><p><a class="reference internal" href="#catchimageexception" id="id79">CatchImageException</a></p></li>
<li><p><a class="reference internal" href="#clippathimage" id="id80">ClipPathImage</a></p></li>
<li><p><a class="reference internal" href="#compositepathimage" id="id81">CompositePathImage</a></p></li>
<li><p><a class="reference internal" href="#cloneimage" id="id82">CloneImage</a></p></li>
<li><p><a class="reference internal" href="#cloneimageinfo" id="id83">CloneImageInfo</a></p></li>
<li><p><a class="reference internal" href="#destroyimage" id="id84">DestroyImage</a></p></li>
<li><p><a class="reference internal" href="#destroyimageinfo" id="id85">DestroyImageInfo</a></p></li>
<li><p><a class="reference internal" href="#displayimages" id="id86">DisplayImages</a></p></li>
<li><p><a class="reference internal" href="#getimageclipmask" id="id87">GetImageClipMask</a></p></li>
<li><p><a class="reference internal" href="#getimagecompositemask" id="id88">GetImageCompositeMask</a></p></li>
<li><p><a class="reference internal" href="#getimageexception" id="id89">GetImageException</a></p></li>
<li><p><a class="reference internal" href="#getimagegeometry" id="id90">GetImageGeometry</a></p></li>
<li><p><a class="reference internal" href="#getimageinfo" id="id91">GetImageInfo</a></p></li>
<li><p><a class="reference internal" href="#istaintimage" id="id92">IsTaintImage</a></p></li>
<li><p><a class="reference internal" href="#modifyimage" id="id93">ModifyImage</a></p></li>
<li><p><a class="reference internal" href="#referenceimage" id="id94">ReferenceImage</a></p></li>
<li><p><a class="reference internal" href="#removedefinitions" id="id95">RemoveDefinitions</a></p></li>
<li><p><a class="reference internal" href="#resetimagepage" id="id96">ResetImagePage</a></p></li>
<li><p><a class="reference internal" href="#setimageex" id="id97">SetImageEx</a></p></li>
<li><p><a class="reference internal" href="#setimage" id="id98">SetImage</a></p></li>
<li><p><a class="reference internal" href="#setimagecolor" id="id99">SetImageColor</a></p></li>
<li><p><a class="reference internal" href="#setimagecolorregion" id="id100">SetImageColorRegion</a></p></li>
<li><p><a class="reference internal" href="#setimageclipmask" id="id101">SetImageClipMask</a></p></li>
<li><p><a class="reference internal" href="#setimagecompositemask" id="id102">SetImageCompositeMask</a></p></li>
<li><p><a class="reference internal" href="#setimagedepth" id="id103">SetImageDepth</a></p></li>
<li><p><a class="reference internal" href="#setimageopacity" id="id104">SetImageOpacity</a></p></li>
<li><p><a class="reference internal" href="#setimagetype" id="id105">SetImageType</a></p></li>
<li><p><a class="reference internal" href="#stripimage" id="id106">StripImage</a></p></li>
<li><p><a class="reference internal" href="#syncimage" id="id107">SyncImage</a></p></li>
</ul>
</div>
<section id="accessdefinition">
<h1><a class="toc-backref" href="#id72">AccessDefinition</a></h1>
<section id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">const char *AccessDefinition( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *magick,
                              const char *key );</pre>
</section>
<section id="description">
<h2>Description</h2>
<p>AccessDefinition() searches the definitions for an entry matching the
specified magick and key. NULL is returned if no matching entry is found.</p>
<p>The format of the AccessDefinition method is:</p>
<pre class="literal-block">const char *AccessDefinition( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *magick,
                              const char *key );</pre>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
<dt>magick:</dt>
<dd><p>Format ID. This is usually the same as the coder name.</p>
</dd>
<dt>key:</dt>
<dd><p>Key to search for.</p>
</dd>
</dl>
</section>
</section>
<section id="adddefinition">
<h1><a class="toc-backref" href="#id73">AddDefinition</a></h1>
<section id="id2">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail AddDefinition( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *magick, const char *key,
                              const char *value, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id3">
<h2>Description</h2>
<p>AddDefinition() adds a key/value definition to the current map of
definitions in ImageInfo. Definitions may be used by coders/decoders
that read and write images.</p>
<p>The format of the AddDefinition method is:</p>
<pre class="literal-block">MagickPassFail AddDefinition( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *magick, const char *key,
                              const char *value, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
<dt>magick:</dt>
<dd><p>format/classification identifier</p>
</dd>
<dt>key:</dt>
<dd><p>subidentifier within format/classification</p>
</dd>
<dt>value:</dt>
<dd><p>definition value</p>
</dd>
<dt>exception:</dt>
<dd><p>Errors result in updates to this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="adddefinitions">
<h1><a class="toc-backref" href="#id74">AddDefinitions</a></h1>
<section id="id4">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail AddDefinitions( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *options );</pre>
</section>
<section id="id5">
<h2>Description</h2>
<p>AddDefinitions() adds definitions from a key/value based string to the current
map of definitions in ImageInfo. Definitions may be used by coders/decoders
that read and write images.</p>
<p>The format of the AddDefinitions method is:</p>
<pre class="literal-block">MagickPassFail AddDefinitions( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *options );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
<dt>options:</dt>
<dd><p>List of key/value pairs to put in the definitions map. The
format of the string is &quot;key1[=[value1]],key2[=[value2]],...&quot;. A missing
value argument (with or without the equal sign) inserts an empty, zero
length string as value for a key.</p>
</dd>
<dt>exception:</dt>
<dd><p>Errors result in updates to this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="allocateimage">
<h1><a class="toc-backref" href="#id75">AllocateImage</a></h1>
<section id="id6">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *AllocateImage( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
</section>
<section id="id7">
<h2>Description</h2>
<p>AllocateImage() returns a pointer to an image structure initialized to
default values.  Currently a failure in this function results in a fatal
error, resulting in program exit.</p>
<p>The format of the AllocateImage method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *AllocateImage( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>Many of the image default values are set from this
structure.  For example, filename, compression, depth, background color,
and others.</p>
</dd>
</dl>
</section>
</section>
<section id="allocatenextimage">
<h1><a class="toc-backref" href="#id76">AllocateNextImage</a></h1>
<section id="id8">
<h2>Synopsis</h2>
<pre class="literal-block">void AllocateNextImage( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id9">
<h2>Description</h2>
<p>Use AllocateNextImage() to initialize the next image in a sequence to
default values.  The next member of image points to the newly allocated
image.  If there is a memory shortage, next is assigned NULL.</p>
<p>It is expected that the image next pointer is null, since otherwise
there is likely to be a memory leak.  In the future this may be enforced.</p>
<p>The format of the AllocateNextImage method is:</p>
<pre class="literal-block">void AllocateNextImage( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>Many of the image default values are set from this
structure.  For example, filename, compression, depth, background color,
and others.</p>
</dd>
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="animateimages">
<h1><a class="toc-backref" href="#id77">AnimateImages</a></h1>
<section id="id10">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int AnimateImages( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id11">
<h2>Description</h2>
<p>AnimateImages() repeatedly displays an image sequence to any X window
screen.  It returns a value other than 0 if successful.  Check the
exception member of image to determine the reason for any failure.</p>
<p>The format of the AnimateImages method is:</p>
<pre class="literal-block">unsigned int AnimateImages( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="appendimages">
<h1><a class="toc-backref" href="#id78">AppendImages</a></h1>
<section id="id12">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *AppendImages( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int stack,
                     <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id13">
<h2>Description</h2>
<p>The AppendImages() method takes a set of images and appends them to each
other top-to-bottom if the stack parameter is true, otherwise left-to-right.</p>
<p>The format of the AppendImage method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *AppendImages( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int stack,
                     <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image sequence.</p>
</dd>
<dt>stack:</dt>
<dd><p>A value other than 0 stacks the images top-to-bottom.</p>
</dd>
<dt>exception:</dt>
<dd><p>Return any errors or warnings in this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="catchimageexception">
<h1><a class="toc-backref" href="#id79">CatchImageException</a></h1>
<section id="id14">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> CatchImageException( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id15">
<h2>Description</h2>
<p>CatchImageException() returns if no exceptions are found in the image
sequence, otherwise it determines the most severe exception and reports
it as a warning or error depending on the severity.</p>
<p>The format of the CatchImageException method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> CatchImageException( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>An image sequence.</p>
</dd>
</dl>
</section>
</section>
<section id="clippathimage">
<h1><a class="toc-backref" href="#id80">ClipPathImage</a></h1>
<section id="id16">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int ClipPathImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *pathname,
                            const unsigned int inside );</pre>
</section>
<section id="id17">
<h2>Description</h2>
<p>ClipPathImage() sets the image clip mask based any clipping path information
if it exists.</p>
<p>The format of the ClipPathImage method is:</p>
<pre class="literal-block">unsigned int ClipPathImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *pathname,
                            const unsigned int inside );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>pathname:</dt>
<dd><p>name of clipping path resource. If name is preceded by #, use
clipping path numbered by name.</p>
</dd>
<dt>inside:</dt>
<dd><p>if non-zero, later operations take effect inside clipping path.
Otherwise later operations take effect outside clipping path.</p>
</dd>
</dl>
</section>
</section>
<section id="compositepathimage">
<h1><a class="toc-backref" href="#id81">CompositePathImage</a></h1>
<section id="id18">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int CompositePathImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *pathname,
                                 const unsigned int inside );</pre>
</section>
<section id="id19">
<h2>Description</h2>
<p>CompositePathImage() sets the image composite mask based any compositing path information
if it exists.</p>
<p>The format of the CompositePathImage method is:</p>
<pre class="literal-block">unsigned int CompositePathImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *pathname,
                                 const unsigned int inside );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>pathname:</dt>
<dd><p>name of compositing path resource. If name is preceded by #, use
compositing path numbered by name.</p>
</dd>
<dt>inside:</dt>
<dd><p>if non-zero, later operations take effect inside compositing path.
Otherwise later operations take effect outside compositing path.</p>
</dd>
</dl>
</section>
</section>
<section id="cloneimage">
<h1><a class="toc-backref" href="#id82">CloneImage</a></h1>
<section id="id20">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *CloneImage( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned long columns,
                   const unsigned long rows, const unsigned int orphan,
                   <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id21">
<h2>Description</h2>
<p>CloneImage() copies an image and returns the copy as a new image object.
If the specified columns and rows is 0, an exact copy of the image is
returned, otherwise the pixel data is undefined and must be initialized
with the SetImagePixels() and SyncImagePixels() methods.  On failure,
a NULL image is returned and exception describes the reason for the
failure.</p>
<p>The format of the CloneImage method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *CloneImage( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned long columns,
                   const unsigned long rows, const unsigned int orphan,
                   <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>columns:</dt>
<dd><p>The number of columns in the cloned image.</p>
</dd>
<dt>rows:</dt>
<dd><p>The number of rows in the cloned image.</p>
</dd>
<dt>orphan:</dt>
<dd><p>With a value other than 0, the cloned image is an orphan.  An
orphan is a stand-alone image that is not associated with an image list.
In effect, the next and previous members of the cloned image is set to
NULL.</p>
</dd>
<dt>exception:</dt>
<dd><p>Return any errors or warnings in this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="cloneimageinfo">
<h1><a class="toc-backref" href="#id83">CloneImageInfo</a></h1>
<section id="id22">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *CloneImageInfo( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
</section>
<section id="id23">
<h2>Description</h2>
<p>CloneImageInfo() makes a copy of the given image info structure.  If
NULL is specified, a new image info structure is created initialized to
default values.</p>
<p>The format of the CloneImageInfo method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *CloneImageInfo( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
</dl>
</section>
</section>
<section id="destroyimage">
<h1><a class="toc-backref" href="#id84">DestroyImage</a></h1>
<section id="id24">
<h2>Synopsis</h2>
<pre class="literal-block">void DestroyImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id25">
<h2>Description</h2>
<p>DestroyImage() dereferences an image, deallocating memory associated with
the image if the reference count becomes zero.  There is no effect if the
image pointer is null.</p>
<p>In the interest of avoiding dangling pointers or memory leaks, the image
previous and next pointers should be null when this function is called,
and no other image should refer to it.  In the future this may be enforced.</p>
<p>The format of the DestroyImage method is:</p>
<pre class="literal-block">void DestroyImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="destroyimageinfo">
<h1><a class="toc-backref" href="#id85">DestroyImageInfo</a></h1>
<section id="id26">
<h2>Synopsis</h2>
<pre class="literal-block">void DestroyImageInfo( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
</section>
<section id="id27">
<h2>Description</h2>
<p>DestroyImageInfo() deallocates memory associated with a ImageInfo
structure.</p>
<p>The format of the DestroyImageInfo method is:</p>
<pre class="literal-block">void DestroyImageInfo( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
</dl>
</section>
</section>
<section id="displayimages">
<h1><a class="toc-backref" href="#id86">DisplayImages</a></h1>
<section id="id28">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail DisplayImages( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id29">
<h2>Description</h2>
<p>DisplayImages() displays an image sequence to any X window screen.  It
returns MagickPass if successful or MagickFail if not.  Check the
exception member of image to determine the reason for any failure.</p>
<p>The format of the DisplayImages method is:</p>
<pre class="literal-block">MagickPassFail DisplayImages( const <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="getimageclipmask">
<h1><a class="toc-backref" href="#id87">GetImageClipMask</a></h1>
<section id="id30">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *GetImageClipMask( const <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id31">
<h2>Description</h2>
<p>GetImageClipMask returns a reference-counted copy of the current image
clip mask. This copy must be deallocated using DestroyImage() once it is
no longer needed.  If the image does not have an associated clip mask,
then NULL is returned.  Use SetImageClipMask() to add a clip mask to an
image, or remove a clip mask.</p>
<p>If a component of the clip mask is set to TransparentOpacity (maximum
value) then the corresponding image pixel component will not be updated
when SyncImagePixels() is applied. The clip mask may be used to constrain
the results of an image processing operation to a region of the image.
Regions outside those allowed by the clip mask may be processed, but only
pixel quantums allowed by the clip mask will actually be updated.</p>
<p>The clip mask protects the DirectClass pixels and PseudoClass pixel indexes
from modification. The clip mask does <em>not</em> protect the image colormap since
the image colormap is globally shared by all pixels in a PseudoClass image.</p>
<p>The format of the GetImageClipMask method is</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *GetImageClipMask( const <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>exception:</dt>
<dd><p>Reason for failure.</p>
</dd>
</dl>
</section>
</section>
<section id="getimagecompositemask">
<h1><a class="toc-backref" href="#id88">GetImageCompositeMask</a></h1>
<section id="id32">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *GetImageCompositeMask( const <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id33">
<h2>Description</h2>
<p>GetImageCompositeMask returns a reference-counted copy of the current image
composite mask. This copy must be deallocated using DestroyImage() once it is
no longer needed.  If the image does not have an associated composite mask,
then NULL is returned.  Use SetImageCompositeMask() to add a composite mask to an
image, or remove a composite mask.</p>
<p>If a component of the composite mask is set to TransparentOpacity (maximum
value) then the corresponding image pixel component will not be updated
when SyncImagePixels() is applied. The composite mask may be used to constrain
the results of an image processing operation to a region of the image.
Regions outside those allowed by the composite mask may be processed, but only
pixel quantums allowed by the composite mask will actually be updated.</p>
<p>The composite mask protects the DirectClass pixels and PseudoClass pixel indexes
from modification. The composite mask does <em>not</em> protect the image colormap since
the image colormap is globally shared by all pixels in a PseudoClass image.</p>
<p>The format of the GetImageCompositeMask method is</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *GetImageCompositeMask( const <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>exception:</dt>
<dd><p>Reason for failure.</p>
</dd>
</dl>
</section>
</section>
<section id="getimageexception">
<h1><a class="toc-backref" href="#id89">GetImageException</a></h1>
<section id="id34">
<h2>Synopsis</h2>
<pre class="literal-block">void GetImageException( <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id35">
<h2>Description</h2>
<p>GetImageException() traverses an image sequence and returns any
error more severe than noted by the exception parameter.</p>
<p>The format of the GetImageException method is:</p>
<pre class="literal-block">void GetImageException( <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>Specifies a pointer to a list of one or more images.</p>
</dd>
<dt>exception:</dt>
<dd><p>return the highest severity exception.</p>
</dd>
</dl>
</section>
</section>
<section id="getimagegeometry">
<h1><a class="toc-backref" href="#id90">GetImageGeometry</a></h1>
<section id="id36">
<h2>Synopsis</h2>
<pre class="literal-block">int GetImageGeometry( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *geometry,
                      const unsigned int size_to_fit, <a class="reference external" href="../api/types.html#rectangleinfo">RectangleInfo</a> *region_info );</pre>
</section>
<section id="id37">
<h2>Description</h2>
<p>GetImageGeometry() returns a region as defined by the geometry string with
respect to the image and its gravity.</p>
<p>The format of the GetImageGeometry method is:</p>
<pre class="literal-block">int GetImageGeometry( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *geometry,
                      const unsigned int size_to_fit, <a class="reference external" href="../api/types.html#rectangleinfo">RectangleInfo</a> *region_info );</pre>
<dl class="simple">
<dt>flags:</dt>
<dd><p>Method GetImageGeometry returns a bitmask that indicates
which of the four values were located in the geometry string.</p>
</dd>
<dt>geometry:</dt>
<dd><p>The geometry (e.g. 100x100+10+10).</p>
</dd>
<dt>size_to_fit:</dt>
<dd><p>A value other than 0 means to scale the region so it
fits within the specified width and height.</p>
</dd>
<dt>region_info:</dt>
<dd><p>The region as defined by the geometry string with
respect to the image and its gravity.</p>
</dd>
</dl>
</section>
</section>
<section id="getimageinfo">
<h1><a class="toc-backref" href="#id91">GetImageInfo</a></h1>
<section id="id38">
<h2>Synopsis</h2>
<pre class="literal-block">void GetImageInfo( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
</section>
<section id="id39">
<h2>Description</h2>
<p>GetImageInfo() initializes image_info to default values.</p>
<p>The format of the GetImageInfo method is:</p>
<pre class="literal-block">void GetImageInfo( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
</dl>
</section>
</section>
<section id="istaintimage">
<h1><a class="toc-backref" href="#id92">IsTaintImage</a></h1>
<section id="id40">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int IsTaintImage( const <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id41">
<h2>Description</h2>
<p>IsTaintImage() returns a value other than 0 if any pixel in the image
has been altered since it was first constituted.</p>
<p>The format of the IsTaintImage method is:</p>
<pre class="literal-block">unsigned int IsTaintImage( const <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="modifyimage">
<h1><a class="toc-backref" href="#id93">ModifyImage</a></h1>
<section id="id42">
<h2>Synopsis</h2>
<pre class="literal-block">ModifyImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id43">
<h2>Description</h2>
<p>ModifyImage() ensures that there is only a single reference to the image
to be modified, updating the provided image pointer to point to a clone of
the original image if necessary.</p>
<p>The format of the ModifyImage method is:</p>
<pre class="literal-block">ModifyImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>exception:</dt>
<dd><p>Return any errors or warnings in this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="referenceimage">
<h1><a class="toc-backref" href="#id94">ReferenceImage</a></h1>
<section id="id44">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *ReferenceImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id45">
<h2>Description</h2>
<p>ReferenceImage() increments the reference count associated with an image
returning a pointer to the image.</p>
<p>The format of the ReferenceImage method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#image">Image</a> *ReferenceImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="removedefinitions">
<h1><a class="toc-backref" href="#id95">RemoveDefinitions</a></h1>
<section id="id46">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail RemoveDefinitions( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *options );</pre>
</section>
<section id="id47">
<h2>Description</h2>
<p>RemoveDefinitions() removes definitions from the current map of definitions
in ImageInfo. Definitions may be used by coders/decoders that read and
write images. RemoveDefinitions() returns true only if the specified keys
are present in the map and are actually removed.</p>
<p>The format of the RemoveDefinitions method is:</p>
<pre class="literal-block">MagickPassFail RemoveDefinitions( <a class="reference external" href="../api/types.html#imageinfo">ImageInfo</a> *image_info, const char *options );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image_info:</dt>
<dd><p>The image info.</p>
</dd>
<dt>keys:</dt>
<dd><p>List of keys to remove from the definitions map. The
format of the string is &quot;key1,key2,...&quot;. A special key, '*', removes
all the key/value pairs in the definitions map. This key always
succeeds.</p>
</dd>
<dt>exception:</dt>
<dd><p>Errors result in updates to this structure.</p>
</dd>
</dl>
</section>
</section>
<section id="resetimagepage">
<h1><a class="toc-backref" href="#id96">ResetImagePage</a></h1>
<section id="id48">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail ResetImagePage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *page );</pre>
</section>
<section id="id49">
<h2>Description</h2>
<p>ResetImagePage adjusts the current page canvas and position based on a
relative page specification.</p>
<p>The format of the ResetImagePage method is:</p>
<pre class="literal-block">MagickPassFail ResetImagePage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *page );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>page:</dt>
<dd><p>Relative page offset adjustment</p>
</dd>
</dl>
</section>
</section>
<section id="setimageex">
<h1><a class="toc-backref" href="#id97">SetImageEx</a></h1>
<section id="id50">
<h2>Synopsis</h2>
<pre class="literal-block">void SetImageEx( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#quantum">Quantum</a> opacity, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id51">
<h2>Description</h2>
<p>SetImageEx() sets the red, green, and blue components of each pixel to
the image background color and the opacity component to the specified
level of transparency.  The background color is defined by the
background_color member of the image.</p>
<p>The format of the SetImageEx method is:</p>
<pre class="literal-block">void SetImageEx( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#quantum">Quantum</a> opacity, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>opacity:</dt>
<dd><p>Set each pixel to this level of transparency.</p>
</dd>
<dt>exception:</dt>
<dd><p>Report any exception here.</p>
</dd>
</dl>
</section>
</section>
<section id="setimage">
<h1><a class="toc-backref" href="#id98">SetImage</a></h1>
<section id="id52">
<h2>Synopsis</h2>
<pre class="literal-block">void SetImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#quantum">Quantum</a> opacity );</pre>
</section>
<section id="id53">
<h2>Description</h2>
<p>SetImage() sets the red, green, and blue components of each pixel to
the image background color and the opacity component to the specified
level of transparency.  The background color is defined by the
background_color member of the image. Any exception is reported to
the image.</p>
<p>The format of the SetImage method is:</p>
<pre class="literal-block">void SetImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#quantum">Quantum</a> opacity );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>opacity:</dt>
<dd><p>Set each pixel to this level of transparency.</p>
</dd>
</dl>
</section>
</section>
<section id="setimagecolor">
<h1><a class="toc-backref" href="#id99">SetImageColor</a></h1>
<section id="id54">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail SetImageColor( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#pixelpacket">PixelPacket</a> *pixel );</pre>
</section>
<section id="id55">
<h2>Description</h2>
<p>SetImageColor() sets the red, green, blue and opacity components of each
pixel to those from a specified pixel value.</p>
<p>The format of the SetImageColor method is:</p>
<pre class="literal-block">MagickPassFail SetImageColor( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#pixelpacket">PixelPacket</a> *pixel );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>pixel:</dt>
<dd><p>Set each pixel in the image to this pixel's color and transparency.</p>
</dd>
</dl>
</section>
</section>
<section id="setimagecolorregion">
<h1><a class="toc-backref" href="#id100">SetImageColorRegion</a></h1>
<section id="id56">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail SetImageColorRegion( <a class="reference external" href="../api/types.html#image">Image</a> *image, long x, long y, unsigned long width,
                                    unsigned long height, const <a class="reference external" href="../api/types.html#pixelpacket">PixelPacket</a> *pixel );</pre>
</section>
<section id="id57">
<h2>Description</h2>
<p>SetImageColorRegion() sets the red, green, blue and opacity components
of each pixel in the specified region to those from a specified pixel
value.  Please note that it is assumed that the pixel value is in
the same colorspace as the image.</p>
<p>The format of the SetImageColorRegion method is:</p>
<pre class="literal-block">MagickPassFail SetImageColorRegion( <a class="reference external" href="../api/types.html#image">Image</a> *image, long x, long y, unsigned long width,
                                    unsigned long height, const <a class="reference external" href="../api/types.html#pixelpacket">PixelPacket</a> *pixel );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>pixel:</dt>
<dd><p>Set each pixel in the image to this pixel's color and transparency.</p>
</dd>
</dl>
</section>
</section>
<section id="setimageclipmask">
<h1><a class="toc-backref" href="#id101">SetImageClipMask</a></h1>
<section id="id58">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int SetImageClipMask( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#image">Image</a> *clip_mask );</pre>
</section>
<section id="id59">
<h2>Description</h2>
<p>SetImageClipMask() associates a clip mask with the image.  The clip mask
must be the same dimensions as the image.</p>
<p>If a component of the clip mask is set to TransparentOpacity (maximum
value) then the corresponding image pixel component will not be updated
when SyncImagePixels() is applied. The clip mask may be used to constrain
the results of an image processing operation to a region of the image.
Regions outside those allowed by the clip mask may be processed, but only
pixel quantums allowed by the clip mask will actually be updated.</p>
<p>The clip mask protects the DirectClass pixels and PseudoClass pixel indexes
from modification. The clip mask does <em>not</em> protect the image colormap since
the image colormap is globally shared by all pixels in a PseudoClass image.</p>
<p>The format of the SetImageClipMask method is:</p>
<pre class="literal-block">unsigned int SetImageClipMask( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#image">Image</a> *clip_mask );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>clip_mask:</dt>
<dd><p>The image clip mask.</p>
</dd>
</dl>
</section>
</section>
<section id="setimagecompositemask">
<h1><a class="toc-backref" href="#id102">SetImageCompositeMask</a></h1>
<section id="id60">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int SetImageCompositeMask( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#image">Image</a> *composite_mask );</pre>
</section>
<section id="id61">
<h2>Description</h2>
<p>SetImageCompositeMask() associates a composite mask with the image.  The mask
must be the same dimensions as the image.</p>
<p>If a component of the composite mask is set to TransparentOpacity (maximum
value) then the corresponding image pixel component will not be updated
when SyncImagePixels() is applied. The composite mask may be used to composite
the results of an image processing operation to a region of the image.
Regions outside those allowed by the composite mask may be processed, but only
pixel quantums covered by the composite mask will actually be updated.</p>
<p>The composite mask protects the DirectClass pixels and PseudoClass pixel indexes
from modification. The composite mask does <em>not</em> protect the image colormap since
the image colormap is globally shared by all pixels in a PseudoClass image.</p>
<p>The format of the SetImageCompositeMask method is:</p>
<pre class="literal-block">unsigned int SetImageCompositeMask( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#image">Image</a> *composite_mask );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>composite_mask:</dt>
<dd><p>The image composite mask.</p>
</dd>
</dl>
</section>
</section>
<section id="setimagedepth">
<h1><a class="toc-backref" href="#id103">SetImageDepth</a></h1>
<section id="id62">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int SetImageDepth( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned long depth );</pre>
</section>
<section id="id63">
<h2>Description</h2>
<p>SetImageDepth() translates the pixel quantums across all of the channels
so that if they are later divided to fit within the specified bit
depth, that no additional information is lost (i.e. no remainder will
result from the division).  Note that any subsequent image processing is
likely to increase the effective depth of the image channels. A non-zero
value is returned if the operation is successful. Check the exception
member of image to determine the cause for any failure.</p>
<p>The format of the SetImageDepth method is:</p>
<pre class="literal-block">unsigned int SetImageDepth( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned long depth );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image to update.</p>
</dd>
<dt>depth:</dt>
<dd><p>Desired image depth (range 1 to QuantumDepth)</p>
</dd>
</dl>
</section>
</section>
<section id="setimageopacity">
<h1><a class="toc-backref" href="#id104">SetImageOpacity</a></h1>
<section id="id64">
<h2>Synopsis</h2>
<pre class="literal-block">void SetImageOpacity( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int opacity );</pre>
</section>
<section id="id65">
<h2>Description</h2>
<p>SetImageOpacity() attenuates the opacity channel of an image.  If the
image pixels are opaque, they are set to the specified opacity level.
Otherwise, the pixel opacity values are blended with the supplied
transparency value.</p>
<p>The format of the SetImageOpacity method is:</p>
<pre class="literal-block">void SetImageOpacity( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int opacity );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>opacity:</dt>
<dd><p>The level of transparency: 0 is fully opaque and MaxRGB is
fully transparent.</p>
</dd>
</dl>
</section>
</section>
<section id="setimagetype">
<h1><a class="toc-backref" href="#id105">SetImageType</a></h1>
<section id="id66">
<h2>Synopsis</h2>
<pre class="literal-block">( void )SetImageType( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#imagetype">ImageType</a> image_type );</pre>
</section>
<section id="id67">
<h2>Description</h2>
<p>(void) SetImageType() sets the type of image.  Choose from these types:</p>
<p>BilevelType, GrayscaleType, GrayscaleMatteType, PaletteType,
PaletteMatteType, TrueColorType, TrueColorMatteType,
ColorSeparationType, ColorSeparationMatteType, OptimizeType</p>
<p>The format of the (void) SetImageType method is:</p>
<pre class="literal-block">( void )SetImageType( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#imagetype">ImageType</a> image_type );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>image_type:</dt>
<dd><p>Image type.</p>
</dd>
</dl>
</section>
</section>
<section id="stripimage">
<h1><a class="toc-backref" href="#id106">StripImage</a></h1>
<section id="id68">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail StripImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id69">
<h2>Description</h2>
<p>StripImage removes all profiles and text attributes from the image.</p>
<p>The format of the StripImage method is:</p>
<pre class="literal-block">MagickPassFail StripImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="syncimage">
<h1><a class="toc-backref" href="#id107">SyncImage</a></h1>
<section id="id70">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail SyncImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id71">
<h2>Description</h2>
<p>Method SyncImage initializes the red, green, and blue intensities of each
pixel as defined by the colormap index and the current image colormap.
This is a helper function to update the DirectClass representation of
the image pixels after the PseudoClass representation has been updated.</p>
<p>The format of the SyncImage method is:</p>
<pre class="literal-block">MagickPassFail SyncImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
